import request from '../request/request';


interface SuccessCase {
        id : number
        type : string
        url : string
        name : string
        message : string
}

const url="/success_case"
export default class SuccessCaseApi{
     // 查询
     static getList = () => {
        return request({
            url: '/v1/'+url,
            // params: {current, size},
            method: 'GET',
        })
    }

    // 查询一个
    static getOne = (id:string) =>{
        return request({
            url: '/v1/'+url+'/'+id,
            method: 'GET',
        })
    }

    // 修改
    static update=(data:SuccessCase)=>{
        return request({
            url: '/v1/'+url,
            data: data,
            method: 'PUT',
        })
    }

    // 添加
    static add=(data:SuccessCase)=>{
        return request({
            url: '/v1/'+url,
            data: data,
            method: 'POST',
        })
    }

    // 删除
    static delete=(id:string)=>{
        return request({
            url: '/v1/'+url+'/'+id,
            method: 'DELETE',
        })
    }
}